// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use error::{AppErr, ErrorHandler};

mod error;
mod robot;
mod utils;
mod store;

#[tokio::main]
async fn main() -> Result<(), AppErr> {
  
    store::init().await?;

    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![
            robot::is_connect,
            robot::connect,
            robot::disconnect,
            robot::request,

            store::save_named_pos,
            store::del_named_pos,
            store::get_names_pos,

            store::save_linkage,
            store::get_linkage,
            store::del_linkage,
        ])
        .run(tauri::generate_context!())
        .map_app("构建失败")?;
    
    Ok(())
}


